CI debug, codacy excludes, obsolete file deletion. (#196)
authortsteven4 <tsteven4@users.noreply.github.com>
Sun, 17 Jun 2018 14:41:36 +0000 (08:41 -0600)
committerGitHub <noreply@github.com>
Sun, 17 Jun 2018 14:41:36 +0000 (08:41 -0600)
.codacy.yaml
GPSBabel.pro
appveyor.yml
gui/env.sh [deleted file]
tools/ci_tokens [new file with mode: 0755]
tools/travis_script_linux_coverage
tools/travis_script_osx
tools/travis_tokens [deleted file]

index 7aea872c62191e4190abf61d1e575739201bc7f9..f18708f1826e0e041c25b03cbd4086a66db4d5b9 100644 (file)
@@ -1,5 +1,6 @@
 exclude_paths:
   - 'deprecated/**'
+  - 'reference/**'
   - 'shapelib/**'
   - 'zlib/**'
   - coverity_model.cc
index 10a074b21958c48dc384de9a016334aa4ca1eec4..e387c4aa26e23b5a8f1e5fc4fb82d60a0279894a 100644 (file)
@@ -205,8 +205,7 @@ macx|linux{
 }
 
 # build the compilation data base used by clang tools including clang-tidy.
-# I am not sure how to do this on non-linux platforms, bear is linux specific.
-linux{
+macx|linux{
   compile_command_database.target = compile_commands.json
   compile_command_database.commands = make clean; bear make
   QMAKE_EXTRA_TARGETS += compile_command_database
@@ -226,18 +225,15 @@ QMAKE_EXTRA_TARGETS += clang-tidy
 
 # generate coverage report for codacy
 # must use gcc, g++
-# the upload requires CODACY_PROJECT_TOKEN be set.
 # dependencies:
-# wget https://oss.sonatype.org/service/local/repositories/releases/content/com/codacy/codacy-coverage-reporter/4.0.1/codacy-coverage-reporter-4.0.1-assembly.jar
-# extra ubuntu bionic packages: gcovr, openjdk-8-jre-headless, /usr/lib/jvm/java-8-openjdk-amd64/bin/java
-# as of 6/18/2018 you must use java 8, see issue #76, #83 at https://github.com/codacy/codacy-coverage-reporter/issues
+# extra ubuntu bionic packages: gcovr
 linux{
   coverage.commands = make clean;
+  coverage.commands += rm -f gpsbabel_coverage.xml;
   coverage.commands += ln -sf GPSBabel gpsbabel;
   coverage.commands += $(MAKE) CFLAGS=\"$(CFLAGS) -fprofile-arcs -ftest-coverage\" CXXFLAGS=\"$(CXXFLAGS) -fprofile-arcs -ftest-coverage\" LFLAGS=\"$(LFLAGS) --coverage\" &&
   coverage.commands += ./testo &&
   coverage.commands += gcov -r $(SOURCES) &&
-  coverage.commands += gcovr -r . --xml --exclude='zlib/*' --exclude='shapelib/*' -o gpsbabel_coverage.xml &&
-  coverage.commands += java -jar codacy-coverage-reporter-4.0.1-assembly.jar report -l cpp -f -r gpsbabel_coverage.xml
+  coverage.commands += gcovr -r . --xml --exclude='zlib/*' --exclude='shapelib/*' -o gpsbabel_coverage.xml;
   QMAKE_EXTRA_TARGETS += coverage
 }
index 7f8beded7e86330c8755b9bec137f8b75a356c7d..24d6043b7272157832ef984d03cca3857eca290a 100644 (file)
@@ -94,9 +94,10 @@ test_script:
 
 deploy_script:
   - ps: |
+      $env:projdir=(C:\msys64\usr\bin\bash.exe -c "pwd")
+      C:\msys64\usr\bin\bash.exe -lc "cd $env:projdir; ./tools/ci_tokens"
       if (($env:platform -eq "x86") -and ($env:qt -eq "5.9\msvc2015") -and ($env:APPVEYOR_REPO_BRANCH -eq "master"))
       {
-        $env:projdir=(C:\msys64\usr\bin\bash.exe -c "pwd")
         $verid=(Get-Date -UFormat "%Y%m%dT%H%MZ" -Date (Get-Date -Date (git show -s --format="%aI" HEAD)).toUniversalTime()) `
                + '-' + (git rev-parse --short=7 HEAD)
         C:\msys64\usr\bin\bash.exe -lc "cd $env:projdir; ls ./gui/release/*.exe"
diff --git a/gui/env.sh b/gui/env.sh
deleted file mode 100644 (file)
index 01c212c..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-
-export QTDIR=~/qt4/qt-x11-opensource-src-4.4.3
-
-PATH=$QTDIR/bin:$PATH
-LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
-export QT_INSTALL_HEADERS=$QTDIR/include
-export QMAKESPEC=$QTDIR/mkspecs/linux-g++ 
-
-
-
diff --git a/tools/ci_tokens b/tools/ci_tokens
new file mode 100755 (executable)
index 0000000..c717176
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash -e
+
+# echo hashed tokens for debug.
+# this script is run by travis on linux and osx.
+# this script is run by appveyor on windows under bash.
+
+#!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+# don't leak unhashed tokens!
+#!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+set +x
+if [ ! -z "${CODACY_PROJECT_TOKEN+x}" ] ; then
+  echo -n "CODACY_PROJECT_TOKEN hash: "
+  echo -n "$CODACY_PROJECT_TOKEN" | openssl dgst -sha512 | cut -d " " -f 2
+else
+  echo CODACY_PROJECT_TOKEN not set.
+fi
+if [ ! -z "${GITHUB_TOKEN+x}" ] ; then
+  echo -n "GITHUB_TOKEN hash: "
+  echo -n "$GITHUB_TOKEN" | openssl dgst -sha512 | cut -d " " -f 2
+else
+  echo GITHUB_TOKEN not set.
+fi
+set -x
index 82875c7ba3844ad34d236c32d2040a63f351cb77..54731ce058f7de9cb3d0d03763d447cd07b4ab05 100755 (executable)
@@ -1,14 +1,28 @@
 #!/bin/bash -ex
 #
 # generate coverage report and upload to codacy
+
+# extra ubuntu bionic packages: gcovr, openjdk-8-jre-headless, /usr/lib/jvm/java-8-openjdk-amd64/bin/java
+# as of 6/18/2018 you must use java 8, see issue #76, #83 at https://github.com/codacy/codacy-coverage-reporter/issues
+
 which qmake
 export PATH=${HOME}/Qt/5.7/gcc_64/bin:$PATH
 which qmake
 
-# debug tokens
-"$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"/travis_tokens
-
-wget -nv -c https://oss.sonatype.org/service/local/repositories/releases/content/com/codacy/codacy-coverage-reporter/4.0.1/codacy-coverage-reporter-4.0.1-assembly.jar
 qmake
 make coverage
 
+# debug tokens
+"$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"/ci_tokens
+
+#!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+# don't leak unhashed tokens!
+#!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+if [ -v CODACY_PROJECT_TOKEN ] ; then
+  # upload coverate report to codacy.
+  wget -nv -c https://oss.sonatype.org/service/local/repositories/releases/content/com/codacy/codacy-coverage-reporter/4.0.1/codacy-coverage-reporter-4.0.1-assembly.jar
+  java -jar codacy-coverage-reporter-4.0.1-assembly.jar report -l cpp -f -r gpsbabel_coverage.xml
+else
+  echo "Skipping codacy coverage upload as CODACY_PROJECT_TOKEN is not set."
+fi
+
index 3e13b0a27ab908f19587886646089ec76b6915f5..c757ae179ed30a8e89f3aa91576e83d9d21dff8d 100755 (executable)
@@ -11,7 +11,7 @@ MACDEPLOYQT=${MACDEPLOYQT:-macdeployqt}
 VERSIONID=${VERSIONID:-$(date -ju -f %Y-%m-%dT%H:%M:%S%z $(git show -s --format="%aI" HEAD | sed 's/:\(..\)$/\1/') +%Y%m%dT%H%MZ)-$(git rev-parse --short=7 HEAD)}
 
 # debug tokens
-"$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"/travis_tokens
+"$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"/ci_tokens
 
 # build and test the CLI
 $QMAKE GPSBabel.pro && make && make check
diff --git a/tools/travis_tokens b/tools/travis_tokens
deleted file mode 100755 (executable)
index 15e8f79..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash -e
-
-# dont leak unhashed tokens!
-set +x
-if [ ! -z "${CODACY_PROJECT_TOKEN+x}" ] ; then
-  if which sha512sum; then
-    echo -n "CODACY_PROJECT_TOKEN hash: "
-    echo $CODACY_PROJECT_TOKEN | sha512sum
-  else
-    echo CODACY_PROJECT_TOKEN hash unknown.
-  fi
-else
-  echo CODACY_PROJECT_TOKEN not set.
-fi
-if [ ! -z "${GITHUB_TOKEN+x}" ] ; then
-  if which sha512sum; then
-    echo -n "GITHUB_TOKEN hash: "
-    echo $GITHUB_TOKEN | sha512sum
-  else
-    echo GITHUB_TOKEN hash unknown.
-  fi
-else
-  echo GITHUB_TOKEN not set.
-fi
-set -x